import com.wd.live.model.ResponseBean
import com.wd.live.model.bean.CloseLiveBean
import com.wd.live.model.bean.LM_QuerylistBean
import com.wd.live.model.bean.LocalData
import com.wd.live.model.bean.LookBean
import com.wd.live.model.bean.OpenLiveBean
import com.wd.live.model.bean.TuiBean
import com.wd.live.model.bean.TypeBean
import com.wd.live.model.bean.UserShenQingBean
import com.wd.live.model.bean.ZhiBoListBean
import io.reactivex.Observable
import okhttp3.MultipartBody
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.Multipart
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Part
import retrofit2.http.Query
import retrofit2.http.QueryMap

/**
 * 作者：马海钊
 * 时间：2023/8/14 15:40
 * 功能：
 */
interface ApiService {

    //微信登录
    @Headers("Content-Type: application/x-www-form-urlencoded")
    @POST("/live-user/wxLogin")
    fun wxLogin(@QueryMap params: HashMap<String, Any>): Observable<ResponseBean<LocalData.UserInfo>>

    //顶部导航
    @GET("/live-platform/findLiveTypeList")
    fun tabtype(): Observable<TypeBean>

    //直播列表
    @GET("/live-platform/findLiveList")
    @Headers("userId:0")
    fun live(@QueryMap params: HashMap<String, Any>): Observable<ZhiBoListBean>

    //看播
    @Headers("userId:388","sessionId:1693290374114388")
    @GET("/live-platform/watchLive")
    fun looklive(@Query("liveId")liveId:Int):Observable<LookBean>

    //观众申请连麦互动
    @Headers("userId:388","sessionId:1693290374114388")
    @PUT("/live-platform/verify/applyLiveInteract")
    fun usershenqing(@Query("liveId")liveId:Int):Observable<UserShenQingBean>

    //主播查询连麦列表
    @Headers("userId:388","sessionId:1693290374114388")
    @GET("/live-platform/verify/findFansInteractList")
    fun zbquerylist(@Query("liveId")liveId:Int):Observable<LM_QuerylistBean>

    //开启直播
    @Multipart
    @Headers("userId:388","sessionId:1693290374114388")
    @POST("/live-platform/verify/openLive")
    fun openlive(
        @Query("liveType") liveType: Int,
        @Query("liveTitle") liveTitle: String,
        @Query("longitude") longitude: String,
        @Query("latitude") latitude: String,
        @Part part: MultipartBody.Part
    ): Observable<OpenLiveBean>

    //推流
    @Headers("userId:388","sessionId:1693290374114388")
    @PUT("/live-platform/verify/startPushStream")
    fun startPushStream(@Query("liveId")liveId:Int):Observable<TuiBean>?

    //关流
    @Headers("userId:388","sessionId:1693290374114388")
    @DELETE("/live-platform/verify/closeLive")
    fun closePushStream():Observable<CloseLiveBean>

    //查询所有礼物
    @Headers("userId:388","sessionId:1693290374114388")
    @GET("/live-platform/findAllGift")
    fun queryGiftList():Observable<LocalData.QueryGiftBean>

    //送礼
    @Headers("userId:388","sessionId:1693290374114388")
    @POST("/live-platform/verify/handselGift")
    fun sendGift(@Query("giftId")giftId:Int, @Query("liveId")liveId :Int):Observable<LocalData.SendGiftBean>
}